﻿Imports Mysoft.Map.Data
Imports System.Data
Imports System.Web.UI.WebControls
Imports System.Text
Imports System.Web.UI
Imports Mysoft.PubProject.Business

Partial Class Cwjk_SetKjkm_MapBuild
    Inherits Mysoft.Map.Application.Security.AppPage

#Region " Web 窗体设计器生成的代码 "

    '该调用是 Web 窗体设计器所必需的。
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents itemtype As System.Web.UI.WebControls.DropDownList
    Protected WithEvents itemname As System.Web.UI.WebControls.DropDownList
    Protected WithEvents bz As System.Web.UI.WebControls.DropDownList
    Protected WithEvents getform As System.Web.UI.WebControls.DropDownList
    Protected WithEvents yhpayform As System.Web.UI.WebControls.DropDownList
    Protected WithEvents posterminal As System.Web.UI.WebControls.DropDownList
    Protected WithEvents holdbank As System.Web.UI.WebControls.DropDownList
    Protected WithEvents amount As System.Web.UI.HtmlControls.HtmlInputText
    Protected WithEvents exrate As System.Web.UI.HtmlControls.HtmlInputText
    Protected WithEvents Text1 As System.Web.UI.HtmlControls.HtmlInputText
    Protected WithEvents poscode As System.Web.UI.HtmlControls.HtmlInputText
    Protected WithEvents remark As System.Web.UI.HtmlControls.HtmlInputText

    '注意: 以下占位符声明是 Web 窗体设计器所必需的。
    '不要删除或移动它。
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
        '不要使用代码编辑器修改它。
        InitializeComponent()
    End Sub

#End Region

#Region "Repeater初始化函数"
    Private Sub Data_Bind()
        Dim sProjGUID As String = ""
        Dim sFilter As String = ""
        Dim myGetMap As New CwjkMNG

        '查询语句
        Select Case Trim(sOperObject)
            Case "项目"
                sFilter = MyDB.GetProjectFilterExp(Session("UserGUID"), "p_project", Session("BUGUID"), "0101")
                If Trim(sFilter) <> "" Then
                    Dim intOf As Integer

                    sFilter = sFilter.Replace("','", ",").Replace("'", "")
                    intOf = sFilter.IndexOf("(")
                    sFilter = sFilter.Substring(intOf + 1).Replace(")", "")
                End If
                Exit Select
            Case "楼栋"
                sProjGUID = Request.QueryString("projguid")
                Exit Select
            Case "房间"
                Dim myArr() As String

                sProjGUID = Request.QueryString("projguid")
                myArr = sProjGUID.Split(";")

                If myArr.Length > 0 Then
                    sFilter = myArr(1)
                End If

                Exit Select
        End Select

        '自定义控件绑定数据
        Repeater1.BindMode = 1                                          '绑定模式：0 -- SQL 语句绑定，1 -- DataTable 绑定
        Repeater1.PKField = "HsxmMapGUID"
        Repeater1.DataTable = myGetMap.GetKjkmOrHsxmDT("KJKM", Session("BUGUID"), txtCwztGUID.Text, sProjGUID, sOperObject, txtBz.Text, txtKmTypeGUID.Text, txtApplication.Text, sFilter)
        Repeater1.DataBind()                                            '绑定数据

    End Sub

#End Region

    Dim sCwztGUID, sBz, sKmtypeGUID, sOperObject, sOpenRoot As String

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '在此处放置初始化页的用户代码

        If Not IsPostBack Then
            If Not Request.QueryString("Export") Is Nothing Then
                txtIsExport.text = Request.QueryString("Export").ToString
            End If
        End If
        Dim sApplication As String
        sApplication = Request.QueryString("Application")
        txtApplication.Text = Trim(sApplication)

        sCwztGUID = Request.QueryString("cwztguid")
        sBz = Request.QueryString("bz")
        sKmtypeGUID = Request.QueryString("kmtypeguid")
        sOperObject = Request.QueryString("operobject")
        sOpenRoot = Request.QueryString("openroot")

        txtCwztGUID.Text = Trim(sCwztGUID)
        txtBz.Text = Trim(sBz)
        txtKmTypeGUID.Text = Trim(sKmtypeGUID)
        txtOperObject.Text = Trim(sOperObject)
        txtOpenRoot.Text = Trim(sOpenRoot)



        '前端：         __doPostBack(__EVENTTARGET, __EVENTARGUMENT);
        Dim strEventTgt As String = Trim(Request.Form("__EVENTTARGET"))
        Dim strEventArg As String = Trim(Request.Form("__EVENTARGUMENT"))
        Select Case strEventTgt.ToUpper
            Case "REFRESH"                        '修改后刷新显示
                Data_Bind()
                Exit Select
            Case Else
                Data_Bind()
        End Select
    End Sub

End Class
